package com.tiku.controller;


import com.tiku.common.ResultJson;
import com.tiku.controller.DTO.ClearAnswerDTO;
import com.tiku.controller.DTO.QuestionLogDTO;
import com.tiku.service.UserQuestionLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/answers")
@CrossOrigin("*")
public class UserAnswerController {

    @Autowired
    private UserQuestionLogService userQuestionLogService;

    @PostMapping("/log")
    public ResultJson answerLog(@RequestBody QuestionLogDTO questionLogDTO) {

        return userQuestionLogService.answerLog(questionLogDTO);
    }

    @PostMapping("/clearLog")
    public ResultJson clearLog(@RequestBody ClearAnswerDTO clearAnswerDTO) {

        return userQuestionLogService.clearLog(clearAnswerDTO);
    }
}
